package cn.sylinx.horm.example.section10;

import java.util.List;

import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;

import cn.sylinx.horm.core.SqlClient;
import cn.sylinx.horm.dialect.fs.FS;
import cn.sylinx.horm.example.entity.MyExample6;
import lombok.extern.slf4j.Slf4j;

@Slf4j
@Profile("section10")
@Component
public class Section10 implements CommandLineRunner {

    private SqlClient sqlClient;

    public Section10(SqlClient sqlClient) {
        this.sqlClient = sqlClient;
    }

    @Override
    public void run(String... args) throws Exception {
        test();
    }

    void test() {

        List<MyExample6> dataList = sqlClient.query(FS.of(MyExample6.class));
        log.info("dataList -> {}", dataList);
    }
}
